#include <iostream>
#include <cstring>
using namespace std;
struct User{
    char* name;
    char* id;
    int dept;
};

User heads[]={
    "A","a",1,
    "B","b",2,
    "C","c",3,
    "D","d",4,
};

void print(User* u,int n){
    for(int i=0;i<n;i++){
        cout<<u[i].name<<" "<<u[i].id<<" "<<u[i].dept<<endl;
    }
}

int cmp1(const void* p,const void* q){
    return strcmp(static_cast<const User*>(p)->name,static_cast<const User*>(q)->name);
}

int cmp2(const void* p,const void* q){
    return static_cast<const User*>(p)->dept-static_cast<const User*>(q)->dept;
}

int main(){
    
   // ssort(heads,sizeof(heads),cmp1);
    print(heads,4);

   // ssort(heads,sizeof(heads),cmp2);
    print(heads,4);

}
